package com.dqhl.community.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.dqhl.community.fragment.RepairRecordFinishFragment;
import com.dqhl.community.fragment.RepairRecordUnfinishFragment;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by guanluocang on 2016/11/16.
 */
public class RepairRecordPagerAdapter extends FragmentPagerAdapter {
    private List<Fragment> fragmentList;
    public RepairRecordPagerAdapter(FragmentManager fm){
        super(fm);
        initFragment();
    }
    /**
     * 实例两个fragment
     */
    private void initFragment() {
        fragmentList=new ArrayList<>();
        fragmentList.add(new RepairRecordUnfinishFragment());
        fragmentList.add(new RepairRecordFinishFragment());
    }

    @Override
    public Fragment getItem(int position) {
        return fragmentList.get(position);
    }

    @Override
    public int getCount() {
        return fragmentList.size();
    }
}
